home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Programming / amigatalk / examples / penshow.st < prev    next >
Encoding:
Text File  |  2000-02-19  |  947 b   |  50 lines

  1. "
  2.    this is useful only if the plot(3) routines work
  3. "
  4. Class Main
  5. | bic show |
  6. [
  7.    init
  8.       bic  <- Pen new: 'PenShow.st Example:'.
  9.       bic openPlotEnv: 500 @ 350.
  10.       bic setPens:     2 @ 0.
  11.       show <- PenShow new.
  12.       show withPen: bic.
  13. |
  14.    main
  15.       self init.
  16.       self polyShow.
  17.       self spiralShow.
  18.       self formShow.
  19. |
  20.    polyShow
  21.       bic erase.
  22.       bic goTo: 50 @ 50.
  23.  
  24.       (3 to: 8) do: [:i | show poly: i length: 10 ].
  25. |
  26.    spiralShow
  27.       bic erase.
  28.       bic    goTo: 250 @ 250.
  29.       show spiral: 150 angle: 89
  30. |
  31.    formShow   | newForm saveBic |
  32.       newForm <- Form new.
  33.       saveBic <- bic.
  34.  
  35.       bic <- PenSave new.
  36.  
  37.       bic   setForm: newForm.
  38.       bic direction: 0.
  39.  
  40.       show withPen: bic.
  41.       self polyShow.
  42.  
  43.       bic <- saveBic.
  44.  
  45.       newForm with: bic displayAt: -15 @ ( -15 ).
  46.       newForm with: bic displayAt: 0 @ 0.
  47.       newForm with: bic displayAt: 20 @ ( -20 ).
  48.       ^ newForm
  49. ]
  50.